var myChart = echarts.init(document.getElementById("b1"));
//配置绘图参数
var option = {
   
   title: {
       text: '某品牌总销量——张三',
       left: 'center',
   },
   xAxis: {
       type: 'category',
       data: ["周一","周二","周三","周四","周五","周六","周日"],
       name: 'X',
   },
   yAxis: {
       name:"Y",
       min: 10,
       max: 100,
   },
   legend: {
       bottom: 'bottom',
   },
   series: [{
       type:'bar',
       name: '荣耀销量',
       data: [74,85,57,68,72,47,91],
       label: {
           show: true,
           position: 'top',
       },
   },{
   type:'line',
   name: '小米销量',
   data: [85,69,71,25,79,82,80],
   label: {
       show: true,
       position: 'top',
   },
}],
};
//画图
myChart.setOption(option);
var myChart2 = echarts.init(document.getElementById("b2"));
  var option2 = {
      grid: [
          {
              top: '15%',  bottom: '65%',
              left: '90%',  right: '80%',
          },
          {
              left: '90%', right: '80%',
              bottom: '10%',   top: '65%',
          },
        ],
      xAxis: [{gridIndex: 0,        type: 'category',
      data: ['周一','周二','周三','周四','周五','周六','周日'],
      name: '日期',},
        {gridIndex: 1, type: 'category',
        data: ['周一','周二','周三','周四','周五','周六','周日'],
        name: '日期',},
    ],
      yAxis: [{ gridIndex: 0,},
        {gridIndex: 1,},
    ],
        legend: {
            top:'left',
         },
        series: [{
            type:'line',
            data:[74,85,57,68,72,47,91],
            label: {
                show: true,
            },
            name:'荣耀销量',
            xAxisIndex:0,
            yAxisIndex:0,
          },{
             type:'line',
             data:[85,69,71,25,79,82,85],
             label: {
                 show: true,
             },
             name:'小米销量',
             xAxisIndex:0,
             yAxisIndex:0,
           },{
             type:'bar',
             data:[74,85,57,68,72,47,91],
             label: {
                 show: true,
             },
             name:'荣耀销量',
             xAxisIndex:1,
             yAxisIndex:1,
           },{
             type:'bar',
             data:[85,69,71,25,79,82,85],
             label: {
                 show: true,
             },
             name:'小米销量',
             xAxisIndex:1,
             yAxisIndex:1,
           },],
};

myChart2.setOption(option2);
var myChart3 = echarts.init(document.getElementById("b3"));
  var option3 = {
      grid: [
          {
              top: '15%',  bottom: '65%',
              left: '90%',  right: '80%',
          },
          {
              left: '90%', right: '80%',
              bottom: '10%',   top: '65%',
          },
        ],
      xAxis: [{gridIndex: 0,        type: 'category',
      data: ['周一','周二','周三','周四','周五','周六','周日'],
      name: '日期',},
        {gridIndex: 1, type: 'category',
        data: ['周一','周二','周三','周四','周五','周六','周日'],
        name: '日期',},
    ],
      yAxis: [{ gridIndex: 0,},
        {gridIndex: 1,},
    ],
        legend: {
            top:'left',
         },
        series: [{
            type:'line',
            data:[74,85,57,68,72,47,91],
            label: {
                show: true,
            },
            areaStyle:{},
            name:'荣耀销量',
            xAxisIndex:0,
            yAxisIndex:0,
          },{
             type:'line',
             data:[85,69,71,25,79,82,85],
             label: {
                 show: true,
             },
             name:'小米销量',
             areaStyle:{},
             xAxisIndex:0,
             yAxisIndex:0,
           },{
             type:'bar',
             data:[74,85,57,68,72,47,91],
             label: {
                 show: true,
             },
             name:'荣耀销量',
             xAxisIndex:1,
             yAxisIndex:1,
             stack:'总量1',
           },{
             type:'bar',
             data:[85,69,71,25,79,82,85],
             label: {
                 show: true,
             },
             name:'小米销量',
             xAxisIndex:1,
             yAxisIndex:1,
             stack:'总量1',
           },],
};

myChart3.setOption(option3);

var myChart4 = echarts.init(document.getElementById("b4"));
//配置绘图参数
var option4 = {
    series:[{
        type:'pie',
        center: ["25%","50%"],
        radius: [0,"40%"],
        label: {
            show: true,
            position: 'top',
        },
        data:[{
            value: 85,
            name: '小米',
        },{
           value: 71,
           name: '荣耀',
       },{
           value: 74,
           name: 'vivo',
       }],
    },{
       type:'pie',
       center: ["75%","50%"],
       radius: [0,"40%"],
       data:[{
        value: 72,
        name: '小米',
    },{
       value: 47,
       name: '荣耀',
   },{
       value: 57,
       name: 'vivo',
   }],
   }]
};
//画图
myChart4.setOption(option4);